Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

173
Views
window.opener causes error "Uncaught TypeError: Cannot read properties of null (reading 'opener')" if calendar dialog is displayed first

I have a dialog containing a text entry field with a calendar icon that when clicked displays a calendar lookup. Next to that is a button that calls a function to copy the text entry field values to a list of other fields in the dialog. The code is below. If I simply enter a date and hit the Copy button, it works fine. But if I click the calendar icon to select a date from the calendar lookup, the FIRST time I click 'Copy', I get this error:

"Uncaught TypeError: Cannot read properties of null (reading 'opener')"

The SECOND time I click 'Copy', it copies the date to the other fields. Something about clicking the calendar icon first is screwing up opener(). I am not a JS expert so if you have any suggestions, please be explicit with instructions on how to fix it. Thanks in advance for any help!

// DATE TEXT ENTRY FIELD
html += "<tr><td colspan='4'></td><td><input size='18' type='text' id='uphs_samedate'></td>";
// CALENDAR LOOKUP ICON
html += "<td><a style='display:inline;' displaystyle='inline' id='uphs_samedate_img' href='#' title='/Look up a date' onclick=\"sapphire.lookup.date.open('uphs_samedate','','','','MM/dd/yy hh:mm:ss a','S M' );return false;\" tabindex='0'><img title='Lookup a date' border='0' src='WEB-CORE/imageref/flat/16/flat_black_calendar2.svg'></a></td>";
// BUTTON TO COPY DATE FROM TEXT ENTRY FIELD TO OTHER TEXT FIELDS BELOW
html += "<td><button type='button' id='uphs_setdatebutton' onclick='sapphire.ui.dialog.getDialogObject().opener.uphs_colxn_set_copydownvalues("+ dsLength +")'>Copy Down</button></td></tr>";

... [LIST OF TEXT FIELDS TO WHICH TO COPY ABOVE DATE]

about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!